package testClasses.misc;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Random;

import stars.BatchSystemBuilder;
import stars.starSystems.StarSystemModel;

import com.jme3.asset.AssetManager;
import com.jme3.math.Vector3f;

import controller.AbstractController;

import eventManager.EventManager;

import gameAppLayer.GameSettings;
import gameAppLayer.MyMainApp;

public class TestSystemDesigner {
	
	
	
	public GameSettings settings;
	public AssetManager assets;
	public EventManager events;
	
	public void runTest(GameSettings settings, AssetManager assets, EventManager events) {
		Random rand = new Random();
		
		this.settings = settings;
		this.assets = assets;
		this.events = events;
    	
    	ArrayList<Vector3f> locations = new ArrayList<Vector3f>();    	
    	
    	//test starSystem distribution
    	//---------------------------------------
    	for (int i = 0; i < 2; i++) {
    		Vector3f location = new Vector3f(rand.nextFloat()*100, rand.nextFloat()*100, rand.nextFloat()*100);        	
        	locations.add(location);
    	}
    	
    	BatchSystemBuilder sysDesign = new BatchSystemBuilder(settings, assets, events);
    	
    	ArrayList<StarSystemModel> systems = sysDesign.createSystems(locations);
    	StarSystemModel tempSystem = systems.get(0);
    	
//    	System.out.println("Writing!");
//    	try {
//			PrintWriter out = new PrintWriter(new FileWriter("C:\\eclipse\\output\\systemCharacteristics.txt"));
//			out.println(tempSystem);
//			out.write("Hello!");
//			out.close();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		System.out.println("Written and DONE!");
		
		
    	
		
    	//---------------------------------------
		
		
	}
	
	

}
